package com.wu;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @description: <br>
 * @date: 2020/6/15 <br>
 * @author: fei.wu <br>
 */
@Getter
@Setter
@NoArgsConstructor
public class YouHuiRule implements Rule {

    protected String userId;

    public YouHuiRule(String userId) {
        this.userId = userId;
    }

    @Override
    public Integer invoke(Context context,Integer price){
        System.out.println(userId +"使用优惠券.");
        price = price - 10;
        price = context.invokeNext(price);
        return price;
    }

}
